<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>缴费详情</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <link rel="stylesheet" href="/lobsteruiframe/weui/css/weui.css" />
    <link rel="stylesheet" href="/lobsteruiframe/weui/css/weuix.css" />
    <script src="/lobsteruiframe/weui/js/zepto.min.js"></script>
    <script src="/lobsteruiframe/weui/js/zepto.weui.js"></script>
    <script src="/lobsteruiframe/weui/js/swipe.js"></script>
    <script src="/lobsteruiframe/weui/js/macy.js"></script>
    <script src="/jslib/lobster.js"></script>
    <script src="/jslib/template-web.js"></script>

    <style>

    </style>
</head>

<body ontouchstart>
    <div class="container">
        <div class="page-hd">
            <h1 class="page-hd-title" style="text-align:center;">缴费明细</h1>
        </div>
        <div class="page-bd" id="div_content">

        </div>
        <div class="weui-loadmore">
            <i class="weui-loading"></i>
            <span class="weui-loadmore__tips">正在加载</span>
        </div>
    </div>
</body>

</html>

<script>
    lobsterh5.main({
        data: {
            id: 0,
        },
        pageload() {
            var self = this;
            self.data.id = lobsterh5.GetUrlParam("id");
            self.initdata();
            self.initevent();
        },

        initevent() {
            var self = this;
        },
        initdata() {
            var self = this;
            var list = [];
            
            lobsterh5.GETAPI("tsselfpay.getpresfeelist", {id:self.data.id}).then(res => {
                 console.log(res);
                 $(".weui-loadmore").hide();
                 self.showdata(res);
            }).catch(res => {
                console.log(res);
            })

           
        },
        showdata(res){
            var self = this;
            self.inittemp("tplrecord", "div_content", { data: res });
        },
        inittemp(tempid, _id, data) {
            var html = template(tempid, data);
            $("#" + _id).html(html);
        },
        /***
         * 去掉小数点后面无效零
         */
        getRegexNumber(data) {
            const regexp = /(?:\.0*|(\.\d+?)0+)$/
            return data.replace(regexp, '$1')
        },

    });


</script>

<script type="text/template" id="tplrecord">
    <div class="weui-cells__title">
    <div class="weui-flex">
        <div class="weui-flex__item">病人姓名:{{data.head.PatName}}</div>        
    </div>
     <div class="weui-flex">
        <div class="weui-flex__item">订单时间:{{data.head.PayTime}}</div>
    </div>
    <div class="weui-flex">
        <div class="weui-flex__item">订单号: {{data.head.TranserNo}}</div>
    </div>

</div>
<div class="weui-cells" style="margin-top:0">
{{each data.list item }}

    <div class="weui-cell page-hd-desc">
        <div class="weui-cell__bd">
            <p>{{item.ItemName}}</p>
        </div>
        <div class="weui-cell__hd">
            <p>{{item.UnitPrice}} x {{item.Quantity}}</p>
        </div>
    </div>

{{/each}}
</div>
<div class="weui-flex">
    <div class="weui-flex__item" style="display: flex;justify-content: flex-end; color:#FF6600;padding-right:15px;">￥ {{data.head.Fee}}元
    </div>
</div>
</script>